unit salario;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, DBTables, StdCtrls, Mask, rxToolEdit, rxCurrEdit;

type
  TFsalario = class(TForm)
    Label1: TLabel;
    Button1: TButton;
    CurrencyEdit1: TCurrencyEdit;
    Salario: TTable;
    SalarioVALOR: TFloatField;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Fsalario: TFsalario;

implementation

{$R *.dfm}

procedure TFsalario.FormCreate(Sender: TObject);
begin
salario.open;
CurrencyEdit1.Value := salariovalor.value;
end;

procedure TFsalario.Button1Click(Sender: TObject);
begin
if salario.RecordCount = 0 then
   begin
   salario.Append;
   SalarioVALOR.Value := CurrencyEdit1.Value;
   salario.post
end;
if salario.RecordCount = 1 then
   begin
   salario.edit;
   SalarioVALOR.Value := CurrencyEdit1.Value;
   salario.post
end;
close;

end;

procedure TFsalario.FormClose(Sender: TObject; var Action: TCloseAction);
begin
salario.close;
end;

end.
